Question: A $7\times 1$ board is completely covered by $m\times 1$ tiles without overlap; each tile may cover any number of consecutive squares, and each tile lies completely on the board. Each tile is either red, blue, or green. Let $N$ be the number of tilings of the $7\times 1$ board in which all three colors are used at least once. For example, a $1\times 1$ red tile followed by a $2\times 1$ green tile, a $1\times 1$ green tile, a $2\times 1$ blue tile, and a $1\times 1$ green tile is a valid tiling. Note that if the $2\times 1$ blue tile is replaced by two $1\times 1$ blue tiles, this results in a different tiling. Find the remainder when $N$ is divided by $1000$.

Solution: Firstly, we consider how many different ways possible to divide the $7\times 1$ board. We ignore the cases of 1 or 2 pieces since we need at least one tile of each color.
Three pieces: $5+1+1$, $4+2+1$, $4+1+2$, etc, $\dbinom{6}{2}=15$ ways in total (just apply stars and bars here)
Four pieces: $\dbinom{6}{3}=20$
Five pieces: $\dbinom{6}{4}=15$
Six pieces: $\dbinom{6}{5}=6$
Seven pieces: $\dbinom{6}{6}=1$
Secondly, we use Principle of Inclusion-Exclusion to consider how many ways to color them:
Three pieces: $3^3-3\times 2^3+3=6$
Four pieces: $3^4-3\times 2^4+3=36$
Five pieces: $3^5-3\times 2^5+3=150$
Six pieces: $3^6-3\times 2^6+3=540$
Seven pieces: $3^7-3\times 2^7+3=1806$
Finally, we combine them together: $15\times 6+20\times 36+15\times 150+6\times 540+1\times 1806= 8106$.
So the answer is $\boxed{106}$.